<?php

//<editor-fold defaultstate="collapsed" desc="License & Copyright">
/*
 * @license
 */

/**
 *
 * @author Jevgeni Geimanen (jevgeni.geimanen@gmail.com)
 */
//</editor-fold>
class SCButtonFormField extends FormField {

    const BUTTON_TYPE_BUTTON = 'button';
    const BUTTON_TYPE_SUBMIT = 'submit';
    const BUTTON_TYPE_RESET = 'reset';

    //<editor-fold defaultstate="collapsed" desc="Overrides">
    protected function CollectMainTagAttributes(&$attributes) {
        $attributes['type'] = $this->getButtonType();
        $attributes['value'] = $this->getLabel();
        return parent::CollectMainTagAttributes($attributes);
    }

    public function getFieldType() {
        return self::TYPE_BUTTON;
    }
    //</editor-fold>

    //<editor-fold defaultstate="collapsed" desc="ButtonType">
    /**
     * @var string
     */
    private $_ButtonType = self::BUTTON_TYPE_BUTTON;

    /**
     *
     * @return string
     */
    public function getButtonType() {
        return $this->_ButtonType;
    }

    /**
     *
     * @param string $type
     * @return ButtonType 
     */
    public function setButtonType($type) {
        $this->_ButtonType = $type;
        return $this;
    }

    //</editor-fold>
}

?>
